package proxy;

public class Proxy implements Subject {

    private RealSubject realSubject;

    public Proxy() {
        this.realSubject = new RealSubject();
    }

    private void preRequest(){
        System.out.println("Proxy-->preRequest");
    }

    @Override
    public void request() {
        preRequest();
        realSubject.request();
        afterRequest();
    }

    private void afterRequest(){
        System.out.println("Proxy-->afterRequest");
    }
}
